package com.mamba.microservice.rpc.controller;

import com.mamba.microservice.rpc.hello.HelloFacade;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * Copyright ©2020 360jinrong All Rights Reserved
 * 请添加类/接口的说明：
 *
 * @Package: com.mamba.microservice.rpc.controller
 * @author: fangjin
 * @date: 2020年04月21日 18时33分
 */
@Slf4j
@RestController
public class HelloController {
    @Resource
    private HelloFacade helloFacade;

    @RequestMapping(value = "/api/hello/{name}", method = {RequestMethod.GET})
    public String hello(@PathVariable("name") String name) {
        log.debug("发起HelloWorld请求,name:{}", name);
        return helloFacade.sayHello(name);
    }

}
